package com.beerandjesus.blackjack.ui.awt;

import com.beerandjesus.blackjack.deck.Card;
import com.beerandjesus.blackjack.controller.HandController;

import java.awt.*;
import java.util.Iterator;

/**
 * User: reverend
 * Date: Jul 12, 2005
 * Time: 11:45:50 PM
 */
public class CardCanvas extends Canvas {
    protected HandController hand;

    public CardCanvas(HandController hand) {
        this.hand = hand;
    }

    public void paint(Graphics graphics) {
        int x = 0;
        int y = 15;
        Iterator iterator = hand.iterator();
        while (iterator.hasNext()) {
            Card card = (Card) iterator.next();
            graphics.drawString("" + card.getValue(),x+=15, y);
        }
    }
}
